package org.fatmansoft.teach.repository;

import org.fatmansoft.teach.models.*;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface StudentStudentHonorRepository extends JpaRepository<StudentStudentHonor,Integer> {
    @Query(value = "select max(studentStudentHonorId) from StudentStudentHonor ")
    Integer getMaxId();

    StudentStudentHonor findStudentStudentHonorByStudentAndStudentHonor(Student student, StudentHonor studentHonor);

    void deleteByStudentAndStudentHonor(Student student, StudentHonor studentHonor);
    List<StudentStudentHonor> findByStudentPersonNum(String num);

    List<StudentStudentHonor> findByStudentPersonName(String name);
    List<StudentStudentHonor> findByStudentHonorTitle(String title);
    List<StudentStudentHonor> findByStudentHonorLevel(String level);
}
